package main

type person struct {
	age int
}

// 避免 nil 引发 panic
func (p *person) birthday() {
	if p == nil {
		return
	}
	p.age++
}

func main() {
	var nobody *person
	nobody.birthday()
}
